package com.jpa.dao;

import com.jpa.entity.Person;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * <p></p>
 *
 * @author Andy
 * @date 2017/8/23
 */
public interface PersonRepositoryDao extends PagingAndSortingRepository<Person,Integer>,
        JpaSpecificationExecutor<Person>, PersonCustomDao {

    Person findByLastName(String lastName);

    //where lastName like %? and id < ?
    List<Person> getByLastNameEndingWithAndIdLessThan(String lastName, Integer id);

    List<Person> getByAddress_IdGreaterThan(Integer id);
}
